package singleton;

/**
 * Created with IntelliJ IDEA.
 * ClassName: HungrySingle
 * Package: singleton
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-08-13
 * Time: 15:46
 */

//饿汉模式
public class HungrySingle {
    private static HungrySingle instance = new HungrySingle();
    //构造方法私有化
    private HungrySingle(){}
    //提供一个获取方法
    public static HungrySingle getInstance(){
        return instance;
    }
}
